<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "sale".
 *
 * @property string $rowkey
 * @property integer $day_id
 * @property string $sale_nbr
 * @property double $round
 * @property double $cnt
 */
class Sale extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'sale';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('bigdata');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['rowkey'], 'required'],
            [['day_id'], 'integer'],
            [['sale_nbr'], 'string'],
            [['round', 'cnt'], 'number'],
            [['rowkey'], 'string', 'max' => 15],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'rowkey' => 'Rowkey',
            'day_id' => 'Day ID',
            'sale_nbr' => 'Sale Nbr',
            'round' => 'Round',
            'cnt' => 'Cnt',
        ];
    }
}
